package com.guan.poi.xml.config;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * Excel定义
 */
@Data
public class RowConfig implements IAreaConfig {
	private Integer row = 1;

	/** 校验是否展示 **/
	private String filter;

	/** 样式 */
	private PoiStyleConfig style;

	/** Field属性的全部定义 */
	private List<Cel> cels = new ArrayList<>();

	public void setRow(Integer row) {
		if(row != null && row>0) {
			this.row = row;
		}
	}

	@Data
	public class Cel {
		private Integer row = RowConfig.this.row;
		private Integer cel = 1;
		private String value;

		/** 校验是否展示 **/
		private String filter;

		/** 样式 */
		private PoiStyleConfig style;

		/** cell的宽度 */
		private Integer columnWidth;

		/** 当值为空时,字段的默认值 */
		private String defaultValue;

		public void setRow(Integer row) {
			if(row != null && row>0) {
				this.row = row;
			}
		}

		public void setCel(Integer cel) {
			if(cel != null && cel>0) {
				this.cel = cel;
			}
		}
	}
}
